package com.ysd.lis.entity.lab;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ysd.lis.entity.BaseEntity2;
import com.ysd.lis.entity.BaseEntityJpa2;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.sql.Timestamp;

/**
 * <p>
 * 检验业务表
 * </p>
 *
 * @author Bai
 * @since 2023-12-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("LAB_RPTRESULT")
@Entity
@Table(name = "LAB_RPTRESULT")
public class LabRptresult extends BaseEntityJpa2 {

    private static final long serialVersionUID = 1L;

    /**
     * 检验日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField("SAMPLEDA")
    @Column(name = "SAMPLEDA")
    private Timestamp sampleda;

    /**
     * 报告单元
     */
    @TableField("RPT_GROUP")
    @Column(name = "RPT_GROUP")
    private String rptGroup;

    /**
     * 标本号
     */
    @TableField("SAMPLE_NO")
    @Column(name = "SAMPLE_NO")
    private String sampleNo;

    /**
     * 报告项目ID
     */
    @TableField("ITEM_DICT_ID")
    @Column(name = "ITEM_DICT_ID")
    private String itemDictId;

    /**
     * 报告项目代号
     */
    @TableField("ITEM_NO")
    @Column(name = "ITEM_NO")
    private String itemNo;

    /**
     * 报告项目名称
     */
    @TableField("ITEM_NA")
    @Column(name = "ITEM_NA")
    private String itemNa;

    /**
     * 检验结果
     */
    @TableField("TEST_RESULT")
    @Column(name = "TEST_RESULT")
    private String testResult;


    /**
     * 调整前结果
     */
    @TableField("ADJUST_RESULT")
    @Column(name = "ADJUST_RESULT")
    private String adjustResult;

    /**
     * OD值 酶标仪结果时写入
     */
    @TableField("OD")
    @Column(name = "OD")
    private String od;

    /**
     * Cutoff值 酶标仪结果时写入
     */
    @TableField("CUTOFF")
    @Column(name = "CUTOFF")
    private String cutoff;

    /**
     * 结果标志 主要有：H偏高、L偏低、M正常、N阴性、P阳性、W弱阳性、E错误，保留的是代码 H、L、M、N、P、W、E
     */
    @TableField("RESULT_FLAG")
    @Column(name = "RESULT_FLAG")
    private String resultFlag;

    /**
     * 用于存放结果时间
     */
    @TableField("RESULT_TIME_STR")
    @Column(name = "RESULT_TIME_STR")
    private String resultTimeStr;

    /**
     * 参考范围
     */
    @TableField("REF")
    @Column(name = "REF")
    private String ref;

    /**
     * 结果说明
     */
    @TableField("RESULT_DESC")
    @Column(name = "RESULT_DESC")
    private String resultDesc;

    /**
     * 仪器代号 仪器接口写入，启用分组时会用到，一个分组下面有多个仪器。
     */
    @TableField("INSTR_CODE")
    @Column(name = "INSTR_CODE")
    private String instrCode;

    @TableField("INSTR_ID")
    @Column(name = "INSTR_ID")
    private String instrId;

    /**
     * 仪器名称
     */
    @TableField("INSTR_NA")
    @Column(name = "INSTR_NA")
    private String instrNa;

    /**
     * 是否危急值 0是1否
     */
    @TableField("IS_ALARM ")
    @Column(name = "IS_ALARM")
    private Integer isAlarm;
    /**
     * 危机之后复查结果
     */
    @TableField(exist = false)
    @Transient
    private String reTestResult;
    /**
     * 危急值信息
     */
    @TableField("ALARM_TEXT")
    @Column(name = "ALARM_TEXT")
    private String alarmText;

    /**
     * 危急值类型  1 低危    2  高危
     */
    @TableField("ALARM_TYPE")
    @Column(name = "ALARM_TYPE")
    private String alarmType;

    //异常颜色
    @TableField("CATCH_COLOR")
    @Column(name = "CATCH_COLOR")
    private String catchColor;

    //颜色值影响背景色还是文字颜色   0 /null系统默认   1 背景颜色  2 文字颜色
    @TableField("COLOR_FOR")
    @Column(name = "COLOR_FOR")
    private String colorFor;


    /**
     * 仪器原始结果 ，不可以修改
     */
    @TableField("RAW_DATA")
    @Column(name = "RAW_DATA")
    private String rawData;

    /**
     * 申请项目代号
     */
    @TableField("FEE_CODE")
    @Column(name = "FEE_CODE")
    private String feeCode;

    /**
     * 申请项目名称
     */
    @TableField("FEE_NAME")
    @Column(name = "FEE_NAME")
    private String feeName;

    /**
     * 检测方法，化学发光法,稀释,比浊法,比色法,金标法,其它,通用,来自检测项目维护的数据
     */
    @TableField("EXA_METHOD_ID")
    @Column(name = "EXA_METHOD_ID")
    private String exaMethodId;

    /**
     * 显示顺序
     */
    @TableField("DISPLAY_ORDER")
    @Column(name = "DISPLAY_ORDER")
    private String displayOrder;

    /**
     * 是否需要报告
     */
    @TableField("IS_NEED_TO_REPORT")
    @Column(name = "IS_NEED_TO_REPORT")
    private String isNeedToReport;

    /**
     * 吸光度与临界值的比值
     */
    @TableField("SCO")
    @Column(name = "SCO")
    private String sco;

    /**
     * 循环数阈值(PCR)
     */
    @TableField("CT")
    @Column(name = "CT")
    private String ct;

    /**
     * 字典报告项目危急值水平字典表主键，普通 显示文本写道结果表	危急	特别危急	危重
     */
    @TableField("EXA_CRITICAL_VALUE_LEVEL_ID")
    @Column(name = "EXA_CRITICAL_VALUE_LEVEL_ID")
    private String exaCriticalValueLevelId;

    /**
     * 备注1
     */
    @TableField("REMARK1")
    @Column(name = "REMARK1")
    private String remark1;

    /**
     * 备注2
     */
    @TableField("REMARK2")
    @Column(name = "REMARK2")
    private String remark2;

    /**
     * 备注3
     */
    @TableField("REMARK3")
    @Column(name = "REMARK3")
    private String remark3;

    /**
     * 备注4
     */
    @TableField("REMARK4")
    @Column(name = "REMARK4")
    private String remark4;

    /**
     * 检验主记录id
     */
    @TableField("MAININFO_ID")
    @Column(name = "MAININFO_ID")
    private String maininfoId;
    /**
     * 仪器结果id
     */
    @TableField("INT_RESULT_ID")
    @Column(name = "INT_RESULT_ID")
    private String intResultId;

    @TableField(exist = false)
    @Transient
    private String feeId;

    @TableField(exist = false)
    @Transient
    private String rptGroupName;

    @TableField(exist = false)
    @Transient
    private String sampleType;

    @TableField(exist = false)
    @Transient
    private String reqNo;

    @TableField(exist = false)
    @Transient
    private String patNo;

    @TableField(exist = false)
    @Transient
    private String patNa;

    @TableField(exist = false)
    @Transient
    private Integer isUrgent;

    @TableField(exist = false)
    @Transient
    private String sex;

    @TableField(exist = false)
    @Transient
    private String reqDept;

    @TableField(exist = false)
    @Transient
    private String itemUnit;

    @TableField(exist = false)
    @Transient
    private Integer isCalcItem;

    @TableField("EXCEPTION_SYMBOL")
    @Column(name = "EXCEPTION_SYMBOL")
    private String exceptionSymbol;

    /**
     * 是否有值 1是0否
     */
    @TableField("IS_RESULT")
    @Column(name = "IS_RESULT")
    private Integer isResult;

    /**
     * 是否有值 1是0否
     */
    @TableField("IS_BIG_TEXT")
    @Column(name = "IS_BIG_TEXT")
    private Integer isBigText;

    //是否对照申请项目 1是0否
    @TableField(exist = false)
    @Transient
    private Integer isContrast;

    //是否模板添加的结果
    @TableField(exist = false)
    @Transient
    private Integer isTemplateResult;

    //是否模板添加的结果
    @TableField(exist = false)
    @Transient
    private Integer resultCount;

}
